﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text;
using Aandelendelen.Obs;

namespace Aandelendelen.Ad
{
	public class AdvertiseCost
	{
		string description;
		int from;
		int to;
		decimal cost;
		string costPrefix;

		public AdvertiseCost(string description, int from, int to, decimal cost, string costPrefix)
		{
			this.description = description;
			this.from = from;
			this.to = to;
			this.cost = cost;
			this.costPrefix = costPrefix;
		}

		public string RangeString
		{
			get
			{
				StringBuilder str = new StringBuilder(32);

				str.Append(this.from);
				str.Append(" - ");
				str.Append(this.to);

				return str.ToString();
			}
		}

		public string CostString
		{
			get
			{
				StringBuilder str = new StringBuilder(32);

				if (string.IsNullOrEmpty(this.costPrefix) == false)
				{
					str.Append(this.costPrefix);
					str.Append(" ");
				}

				str.Append(ObjectFormatter.GetCurrencyString(this.cost));

				return str.ToString();
			}
		}

		public string Description
		{
			get { return this.description; }
		}

		public int From
		{
			get { return this.from; }
		}

		public int To
		{
			get { return this.to; }
		}

		public decimal Cost
		{
			get { return this.cost; }
		}

		public string CostPrefix
		{
			get { return this.costPrefix; }
		}

	}
}